home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6114 < prev    next >
Encoding:
Text File  |  1996-08-05  |  588 b   |  27 lines

  1. Path: ukcc.uky.edu!JJSTEP00
  2. From: JJSTEP00@ukcc.uky.edu (Jason Stephenson)
  3. Newsgroups: comp.lang.c
  4. Subject: Passing structures--related Q
  5. Date: Thu, 22 Feb 96 14:48:16 EST
  6. Organization: The University of Kentucky
  7. Message-ID: <17735D030S86.JJSTEP00@ukcc.uky.edu>
  8. NNTP-Posting-Host: ukcc.uky.edu
  9.  
  10. Say you have the following struct defined:
  11.  
  12. struct point
  13. {
  14.     int    x, y;
  15. }
  16.  
  17. Given the prototyp below:
  18.     void some_func(point myPoint)
  19.  
  20. can you safely do this:
  21.  
  22. /* code */
  23. some_func({x, y});
  24. /* more code */
  25.  
  26. What I'm trying to figure out is, can you replace a struct with its values?
  27.